﻿using UnityEngine;
using Newtonsoft.Json;


public enum Platform
{
	unknown,
	ios,
	android,
	win64,
}

public static class PlatformEx
{
	public static Platform getPlatform()
	{
		return UnityEngine.Application.platform.getPlatform();
	}

	public static Platform getPlatform(this UnityEngine.RuntimePlatform platform)
	{
		switch(platform)
		{
			case UnityEngine.RuntimePlatform.IPhonePlayer:
			{
				return Platform.ios;
			}
			case UnityEngine.RuntimePlatform.Android:
			{
				return Platform.android;
			}
			case UnityEngine.RuntimePlatform.WindowsPlayer:
			{
				return Platform.win64;
			}
			default:
			{
#if UNITY_IOS
			return Platform.ios;
#elif UNITY_ANDROID
			return Platform.android;
#else
			if(Application.isEditor)
			{
				// return Platform.android;
			}
			return Platform.unknown;
#endif
			}
		}
	}
}

